/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Mark
 */
@Entity
@Table(name = "managers", catalog = "ticketsaler", schema = "")
@NamedQueries({@NamedQuery(name = "Managers.findAll", query = "SELECT m FROM Managers m"), @NamedQuery(name = "Managers.findByMid", query = "SELECT m FROM Managers m WHERE m.mid = :mid"), @NamedQuery(name = "Managers.findByMname", query = "SELECT m FROM Managers m WHERE m.mname = :mname"), @NamedQuery(name = "Managers.findByMpassword", query = "SELECT m FROM Managers m WHERE m.mpassword = :mpassword"), @NamedQuery(name = "Managers.findByMphone", query = "SELECT m FROM Managers m WHERE m.mphone = :mphone"), @NamedQuery(name = "Managers.findByMemail", query = "SELECT m FROM Managers m WHERE m.memail = :memail")})
public class Managers implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MID")
    private Integer mid;
    @Basic(optional = false)
    @Column(name = "MNAME")
    private String mname;
    @Basic(optional = false)
    @Column(name = "MPASSWORD")
    private String mpassword;
    @Basic(optional = false)
    @Column(name = "MPHONE")
    private int mphone;
    @Basic(optional = false)
    @Column(name = "MEMAIL")
    private String memail;

    public Managers() {
    }

    public Managers(Integer mid) {
        this.mid = mid;
    }

    public Managers(Integer mid, String mname, String mpassword, int mphone, String memail) {
        this.mid = mid;
        this.mname = mname;
        this.mpassword = mpassword;
        this.mphone = mphone;
        this.memail = memail;
    }

    public Integer getMid() {
        return mid;
    }

    public void setMid(Integer mid) {
        Integer oldMid = this.mid;
        this.mid = mid;
        changeSupport.firePropertyChange("mid", oldMid, mid);
    }

    public String getMname() {
        return mname;
    }

    public void setMname(String mname) {
        String oldMname = this.mname;
        this.mname = mname;
        changeSupport.firePropertyChange("mname", oldMname, mname);
    }

    public String getMpassword() {
        return mpassword;
    }

    public void setMpassword(String mpassword) {
        String oldMpassword = this.mpassword;
        this.mpassword = mpassword;
        changeSupport.firePropertyChange("mpassword", oldMpassword, mpassword);
    }

    public int getMphone() {
        return mphone;
    }

    public void setMphone(int mphone) {
        int oldMphone = this.mphone;
        this.mphone = mphone;
        changeSupport.firePropertyChange("mphone", oldMphone, mphone);
    }

    public String getMemail() {
        return memail;
    }

    public void setMemail(String memail) {
        String oldMemail = this.memail;
        this.memail = memail;
        changeSupport.firePropertyChange("memail", oldMemail, memail);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mid != null ? mid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Managers)) {
            return false;
        }
        Managers other = (Managers) object;
        if ((this.mid == null && other.mid != null) || (this.mid != null && !this.mid.equals(other.mid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.Managers[mid=" + mid + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
